﻿@model LeadMaster.ViewModels.ViewModelSurveys

<div class="spacer"></div>
<label style="border-style: solid; border-color: #660033; color: #800080; font-family: 'Trebuchet MS'; font-size: 22px; margin-left: 20px;">Welcome @Model.Agent</label>
<div class="spacer"></div>

<style type="text/css">
    th
    {
border-style: solid;
    border-width: 1px 0px 1px 0px;
    border-color: #AAA;
    text-align: left;
    font-size: 11px;
    padding-right: 10px;
    vertical-align: middle;
    padding-top: 5px;
    background-color: #99FFCC;
    font-family: Arial, Helvetica, sans-serif;
    height: 20px;
    font-weight: bold;
    color: #808080;
    width: 160px;
    }
</style>

@using (Html.BeginForm())
{
<fieldset style="width: 400px">
<legend style="margin-left: 20px">Survey Start Wizard</legend>

@Html.ValidationSummary(true)

<input type="hidden" name="CallCentreID" value="@(ViewBag.CallCentreID)" />
    
@Html.HiddenFor(m => m.UserID)
@Html.HiddenFor(m => m.CallCentreID)
@Html.HiddenFor(m => m.Agent)
@Html.HiddenFor(m => m.BlockID)
@Html.HiddenFor(m => m.LeadStatusID)
    
<div style="margin-left: 20px;">
<div class="spacer"></div>
@Html.HiddenFor(m => m.SurveyContact.SurveyContactID)
<div><label>Please confirm contact details, amend as necessary</label></div>
<div class="spacer"></div>
<table style="width: 600px;">
<tr><th>Title</th>
<td>
@Html.HiddenFor(m => m.Person.Title)
@Html.DropDownList("Title", null, new { style = "width:180px" })
</td>
<td><label id="msgTitle" style="color: #F00">&nbsp;</label></td></tr>
<tr><th>First Name</th><td>@Html.EditorFor(m => m.Person.Forename)</td><td>@Html.ValidationMessageFor(model => model.Person.Forename)<label style="color: #F00" id="lblTitleFirstname">@ViewBag.fnMessage</label></td></tr>
<tr><th>Last Name</th><td>@Html.EditorFor(m => m.Person.Surname)</td><td>@Html.ValidationMessageFor(model => model.Person.Surname)</td></tr>
<tr><th>House number or name</th><td>@Html.EditorFor(m => m.Person.HouseNum)</td><td>@Html.ValidationMessageFor(model => model.Person.HouseNum)</td></tr>
<tr><th>First line of address</th><td>@Html.EditorFor(m => m.Person.Address1)</td><td>@Html.ValidationMessageFor(model => model.Person.Address1)</td></tr>
<tr><th>Town or City</th><td>@Html.EditorFor(m => m.Person.TownCity)</td><td>@Html.ValidationMessageFor(model => model.Person.TownCity)</td></tr>
<tr><th>County</th><td>@Html.DropDownList("County", null, new { style = "width:180px" })</td><td>@Html.ValidationMessageFor(model => model.Person.County)</td></tr>
<tr><th>Country</th><td>@Html.DropDownList("Country", null, new { style = "width:180px" })</td><td>@Html.ValidationMessageFor(model => model.Person.Country)</td></tr>
<tr><th>Telephone</th><td>@Html.EditorFor(m => m.Person.Telephone)</td><td>@Html.ValidationMessageFor(model => model.Person.Telephone)</td></tr>
<tr><th>Email</th><td>@Html.EditorFor(m => m.Person.Email)</td><td>@Html.ValidationMessageFor(model => model.Person.Email)</td></tr>
<tr><th>Mobile</th><td>@Html.EditorFor(m => m.Person.Mobile)</td><td>@Html.ValidationMessageFor(model => model.Person.Mobile)</td></tr>
<tr><th>Postcode</th><td>@Html.EditorFor(m => m.Person.Postcode)</td><td>@Html.ValidationMessageFor(model => model.Person.Postcode)</td></tr>
</table>
</div>
<div class="spacer"></div>

<table style="width: 400px; margin-left: 20px;">
<tr>
<th style="text-align: left">@Html.Label("Select Survey")</th>
<td>
    @Html.DropDownList("surveyID", null, new { style = "width:300px;" })
</td>
</tr>
</table>

<div style="margin-top: 10px; float: right; clear:both;">
    <input type="submit" value="Begin Survey" class="bigsubmit"/>
</div>

</fieldset>
}

<div>
@Html.ActionLink("Break Out", "BreakOut", new { blockID = @Model.BlockID, agent = @Model.Agent, cc = @Model.CallCentreID }, new { style = "border-style: ridge; font-family: 'Trebuchet MS'; font-size: 18px; color: #800000; font-weight: bolder; margin-left: 20px" })
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}


<script type="text/javascript">
    $(document).ready(function () {

        $("#Title").chosen();
        $("#County").chosen();
        $("#Country").chosen();

        $("#Title").change(function () {
            $("#Person_Title").val($.trim($("#Title").val()));
        });

        $("form").submit(function () {
            $("#lblTitleFirstname").text("");
            if ($("#Person_Title").val() == "") {
                $("#msgTitle").text("Please enter title");
                return false;
            }
            else {
                $("#msgTitle").text("");
            }
            return true;
        });


    });
</script>